<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="nav">
        <a href="#/home">首页</a>
        <a href="#/service">服务</a>
        <a href="#/mine">个人中心</a>
    </div>
    <div class="content"></div>
</body>
</html>
<script>
window.onhashchange=function(){
    switch (location.hash) {
        case'#/home':home_yemian() ;break
        case'#/service':service_yemian();break
        case'#/mine':mine_yemian();break      
    }
}

     //渲染首页的内容
    function home_yemian(){
        document.querySelector('.content').innerHTML='首页的内容'
    }
    //渲染服务的内容
    function service_yemian(){
        document.querySelector('.content').innerHTML='服务的内容'
    }
    //个人中心
    function mine_yemian(){
        document.querySelector('.mine').innerHTML='个人中心的内容'
    }
</script>